<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    function changeWord() {
        var p = document.getElementById("p");
        p.innerHTML = "这是改变之后的文字";
    }

    function insertNewP() {
        var div = document.getElementById("div");
        var newP = document.createElement("p");
        var node = document.createTextNode("这是新段落");
        newP.appendChild(node);
        div.appendChild(newP);
    }
</script>


<div id="div">
    <p id="p1">这是第一段</p>
    <p id="p2">这是第二段</p>
</div>

<button onclick="insertNewP()">点击添加一个新段落</button>
</body>
</html>